import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'

Vue.use(VueRouter)

//  路由设置说明请查看本页底部！！！！！！！！！
const routes = [
    {
        path: '/', // /admin下面是后台管理
        name: 'admin-layout',
        component: () => import('../views/admin/layout.vue'),
        children: [
            //====================默认首页、仪表盘
            {
                path: '',
                name: 'dashboard',
                component: () => import( '../views/admin/dashboard.vue'),
            },
            //====================文章、分类、标签：
            {
                path: '/articles',
                name: '文章管理',
                component: () => import( '../views/admin/articles/list.vue'),
            },
            {
                path: '/articles/edit',
                name: '文章编辑',
                component: () => import( '../views/admin/articles/edit.vue'),
            },
            {
                path: '/categories',
                name: '分类管理',
                component: () => import( '../views/admin/articles/category.vue'),
            },
            //====================用户 角色 权限
            {
                path: '/users',
                name: '用户管理',
                component: () => import( '../views/admin/users/users.vue'),
            },
            {
                path: '/roles',
                name: '角色&权限',
                component: () => import( '../views/admin/users/roles.vue'),
            },
            {
                path: '/members',
                name: '会员管理',
                component: () => import( '../views/admin/users/members.vue'),
            },
            {
                path: '/system/settings',
                name: '网站配置',
                component: () => import( '../views/admin/system/settings.vue'),
            },
            {
                path: '/system/caches',
                name: '缓存管理',
                component: () => import( '../views/admin/system/caches.vue'),
            },

            {
                path: '/demos/drawer',
                name: '抽屉弹窗',
                component: () => import( '../views/admin/demos/drawer.vue'),
            },
            {
                path: '/demos/help',
                name: '使用说明',
                component: () => import( '../views/admin/demos/help.vue'),
            },

        ]
    },
    {
        path: '/login',
        name: 'login',
        component: () => import(/* webpackChunkName: "login" */ '../views/admin/login.vue')
    },
    {
        path: '/about',
        name: 'about',
        // route level code-splitting
        // this generates a separate chunk (about.[hash].js) for this route
        // which is lazy-loaded when the route is visited.
        component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
    }
]

const router = new VueRouter({
    mode: 'history',
    base: process.env.BASE_URL,
    routes
})

export default router


///////////////////////////////////////////////////////      路由目录问题说明文档：
/*
const routesDemo = [
    // 路由设置建议采用以下几种方式

    // 1、独立页面，只一级路由页面
    {
        path: '/login', // 或/xxx/yyy， 但路径不能和板块路由路径相同
        name: 'login',
        component: () => import( '../views/login.vue'),
    },


    //2.板块路由，多级路由页面
    // 前台官网
    {
        path: '/', // 根目录下的官网
        name: 'front',
        component: () => import( '../views/front/layout.vue'), // 使用包含头部、底部内容的公共布局页面，子路由才是该板块的页面内容
        children: [
            // 子页面对于的路由
        ]
    },
    // 后台管理系统
    {
        path: '/admin',
        name: 'admin',
        component: () => import( '../views/admin/layout.vue'),
        children: [
            // 子页面对于的路由
        ]
    },
]
*/
